<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script type="text/javascript">
    var fun = function() {}
    fun.prototype = {
        name : 'peter',
        age : 25
    }

    var a = new fun();
    var b = new fun();
    console.log(a.name,b.name);
    fun.prototype.name = 'jack';
    console.log(a.name,b.name);
    //重写原型
    fun.prototype = {};
    fun.prototype.name = 'tom';
    console.log(a.name,b.name);
    b.constructor.prototype.name = 'kitty';
    console.log(a.name,b.name);
    //a，b 都输出tom 

    //2.protototype, __proto__， constructor y有什么联系



</script>
<body>
    
</body>
</html>